/**
 * @brief 4G 设备加密过滤器模块
 * @version 1.0
 * @date 
 * @author 宋炜
 */
#ifndef CRYPTO_H
#define CRYPTO_H

#include "filterio.h"
class crypto : public filterIO
{
public:
    	enum mtd{ AES , DES , BF , IDEA , SIGNAL };
private:
    	mtd  m_mtd;     // 加密算法
public:
	crypto( filterIO::io_type t , filterList * l );
	virtual ~crypto();
private:
	bool en_aes( size_t len , const char * data , size_t& rlen , char ** rd );
	bool en_des( size_t len , const char * data , size_t& rlen , char ** rd );
	bool en_idea( size_t len , const char * data , size_t& rlen , char ** rd );
	bool en_bf( size_t len , const char * data , size_t& rlen , char ** rd );
	bool en_signal( size_t len , const char * data , size_t& rlen , char ** rd );
	bool de_aes( size_t len , const char * data , size_t& rlen , char ** rd );
	bool de_des( size_t len , const char * data , size_t& rlen , char ** rd );
	bool de_idea( size_t len , const char * data , size_t& rlen , char ** rd );
	bool de_bf( size_t len , const char * data , size_t& rlen , char ** rd );
	bool de_signal( size_t len , const char * data , size_t& rlen , char ** rd );

	bool on_forward( size_t len , const char * date , err_code &err , size_t& rlen , char ** rd );
	bool on_backward( size_t len , const char * data , err_code &err , size_t& rlen , char ** rd  );
};

#endif // CRYPTO_H
